<template>
  <div id="app">
    <div id="nav">
    <div id="button">
        <el-button @click="drawer = true" style="margin-left: 16px;" id="box">
         <i class="el-icon-s-unfold"></i>
         <router-link to="">{{title1}}</router-link>
        </el-button>
    </div>
  </div>
    <el-drawer :visible.sync="drawer" direction="ltr" :with-header="false"  ref="editDrawer">
    <ul class="ul1">
      <router-link to="/">
       <li @click="close" style="color:#fff; height:60px; line-height:60px;margin-left:15px">首页</li>
      </router-link> <br>
      <router-link to="/about">
       <li @click="close" style="color:#fff; height:60px; line-height:60px;margin-left:15px">全部分类</li>
      </router-link> <br>
      <router-link to="/">
         <li @click="close" style="color:#fff; height:60px; line-height:60px;margin-left:15px">推荐</li>
      </router-link> <br>
      <router-link to="/">
       <li  @click="close" style="color:#fff; height:60px; line-height:60px;margin-left:15px">我的</li>
      </router-link>
    </ul>
    </el-drawer>
    <router-view />
  </div>
</template>
<script>
export default {
   props: ["title", "about"],
  data() {
    return {
      drawer: false,
      title1:"首页",
    };
  },
  methods: {
    close() {
      this.$refs.editDrawer.closeDrawer();
    },
  },
  watch: {
  $route:{
    handler:function(val) {
     console.log(val.name);
     this.title1 = val.name;
     },
  }
}
};
</script>
<style>
*{
  margin: 0;
  padding: 0;
  text-decoration: none;
  list-style: none;
}
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: #2c3e50;
}
#nav{
  padding-bottom: 15px;
}
#nav a {
  width: 100%;
  height: 60px;
  line-height: 60px;
  font-weight: bold;
  color: #3879b9;
  text-decoration: none;
}
#nav a.router-link-exact-active {
  color: #42b983;
}
#box{
  height: 40px;
  background-color: #333;
  font-size: 22px;
  border: none;
  color: #fff;
}
#button{
  width: 100%;
  height: 60px;
  padding: 0px;
  margin: 0px;
  background-color: #333;
}
#button span{
  position: relative;
  bottom: 10px;
}
.el-drawer__body{
  background-color: #333;
}
</style>
